<?php
$Set_Title		= $config_nc->Connective;
$p				= $func->html_get('p');
if($p=='' && !$news_class->isInt($p)){
	$p = 1;
}
$p 				= floor($p);
$num			= $config_var->ADMIN_ITEMS;
$MaxP			= $config_var->ADMIN_PAGE;
$min			= $num*($p-1);
$i				= 0;
$RowAll			= $connective_class->GetByAll($num, $min);
$CountRow		= $connective_class->CountByAll();
?>
<div class="dataTables">
	<div class="dataTables_bar fl">
    	<h5 class="title dib"><?php echo $Set_Title;?></h5>
        <div class="dropdown fr">
            <a class="dropdown-toggle db" data-toggle="dropdown" href="#"><i class="icon_cog dib"></i><?php echo $config_nc->Menu;?><i class="caret dib"></i></a>
            <ul class="dropdown-menu">
                <li><a href="<?php echo $WEB_DOMAIN.'/'.$WEB_ADMIN.'/index.php?u1=one-connective';?>"><?php echo $config_nc->Add;?></a></li>
            </ul><!--end dropdown-menu-->
        </div><!_-end dropdown-->
    </div><!--end dataTables_bar-->
    <div id="example_wrapper" class="dataTables_wrapper" role="grid">
    	<div id="example_length" class="dataTables_length"></div>
        <div class="dataTables_filter"><label><?php echo $config_nc->Search;?>: <input type="text" aria-controls="example" name="search"></label></div>    
        <table cellpadding="0" cellspacing="0" border="0" class="display">
            <thead>
                <tr>
                    <th><?php echo $config_nc->STT;?></th>
                    <th><?php echo $connective_nc->Name;?></th>  
                    <th><?php echo $config_nc->status;?></th>
                    <th> </th>
                </tr>
            </thead>        
            <?php if(is_array($RowAll)){?>
            <tbody>
            <?php 
                    $count = count($RowAll); 
                    for($i=0;$i<$count;$i++){                    
            ?>
                <tr class="gradeA <?php if($i%2==1){echo 'odd';}else{echo 'event';}?>">
                    <td><?php echo $i+1+$min;?></td>
                    <td class="center"><?php echo $RowAll[$i]['name'];?> </td>
                    <td class="center">
                        <?php 
                            if($RowAll[$i]['status']==0){
                                echo $config_nc->status_2;
                            }else{
                                echo $config_nc->status_1;
                            }
                        ?>
                    </td>  
                    <td class="center">
                        <a href="<?php echo $WEB_DOMAIN.'/'.$WEB_ADMIN.'/index.php?u1=one-connective&u2='.$RowAll[$i]['id']; ?>"><?php echo $config_nc->View;?></a>
                        &nbsp;&nbsp;&nbsp;
                        <a href="javascript:;" onclick="Del('<?php echo $config_nc->Sure;?>','<?php echo $WEB_DOMAIN.'/'.$WEB_ADMIN.'/index.php?u1=_connective&u2=del&u3='.$RowAll[$i]['id'];?>&p=<?php echo $p;?>');"><?php echo $config_nc->Del;?></a>
                     </td>
                </tr>
            <?php } ?>
            </tbody>
            <?php } ?>             
        </table>
    	<div class="dataTables_info"><?php echo $func->Load_Lag($config_nc->Tool_View,array($min+1,$min+$i,$CountRow));?></div>
        <div class="dataTables_paginate paging_full_numbers">
        <?php		
		$RowPT = $func->GetPageNom($CountRow,$num,$MaxP,$p);
		if(is_array($RowPT) && count($RowPT)>0){
			$Links=$WEB_DOMAIN.'/'.$WEB_ADMIN.'/index.php?u1=list-connective';	
		?>
        <a tabindex="0" class="first paginate_button paginate_button_disabled" href="<?php echo $Links.'&p=1';?>">
			<?php echo $config_nc->First;?>
        </a>
			<?php foreach($RowPT as $k => $v){	?>
				<?php if($v==$p){?>
				<span><a class="paginate_active"><?php echo $v;?></a></span>
				<?php }else{ ?>
				<a href="<?php echo $Links.'&p='.$v;?>" class="paginate_button"><?php echo $v;?></a>
				<?php } ?>
			<?php } ?>
		<a tabindex="0" class="last paginate_button paginate_button_disabled" href="<?php echo $Links.'&p='.$v;?>">
			<?php echo $config_nc->Last;?>
        </a>
		<?php } ?>
        </div>
	</div>    
</div><!--end dataTables-->